<?php
/**
 * Created by PhpStorm.
 * User: 阿里云日志服务
 * Date: 2017/3/16
 * Time: 18:41
 */

namespace SDXApi\Controller;
use Think\Controller;
use SDXApi\Service\AliyunLogService;


class AliyunLogController extends Controller {

    protected $aliyun_log;

    public function __construct()
    {
        $this->aliyun_log = new AliyunLogService();
    }


    public function get_log_list(){


        //$query = "aa=11";
        $query = '';

        $list = $this->aliyun_log->get_log_list($query);
        print_r($list);exit;

    }

    public function write_log(){



        $contents = array(
            'user_id'=> 1,
            'item_id'=> 2,
            'wid' => 8,
            'storageid' => 3,
            'bhv_type' => 'view',
            'bhv_amt' => 1.00,
            'bhv_cnt' => 6,
            'bhv_datetime' => '2017-03-15 17:16:04',
            'page_type' => 8,
            'page_title' => '标题',
            'page_id' => 0,
            'add_time' => gmtime()
        );

        $test = $this->aliyun_log->write_log($contents);
        print_r($test);exit;

    }
}